<?php
/**
 * Clase FN para MrpOrdenProduccionFN
 *
 * @package    
 * @subpackage MrpOrdenProduccionFN
 * @author     hans
 * @version    SVN:: MrpOrdenProduccionFN.class.php,v 1.1 2012-03-07 02:02:33 hans.parra Exp $
 */
require_once($_SERVER['DOCUMENT_ROOT'].'/gourmet-express/trunk/src/class/common/conexion.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/gourmet-express/trunk/src/class/mrp/ordenes/BFN/BaseMrpOrdenProduccionFN.class.php');
class MrpOrdenProduccionFN extends BaseMrpOrdenProduccionFN
{
	
	
	public function  getOpChild($a_params)
	{
		
		try
	    {
	    	$a_tmp = null;
			$where = "";
			if($a_params['pdo_ordenId']){ $where .= " AND pdo_ordenId = '".$a_params['pdo_ordenId']."'"; }
			if($a_params['pdo_ordenIdChild']){ $where .= " AND pdo_ordenIdChild = '".$a_params['pdo_ordenIdChild']."'"; }
			if($a_params['pdo_productoId']){ $where .= " AND pdo_productoId = '".$a_params['pdo_productoId']."'"; }			
			if($a_params['SysInsUsr']){ $where .= " AND SysInsUsr = '".$a_params['SysInsUsr']."'"; }
			if($a_params['SysInsAt']){ $where .= " AND SysInsAt = '".$a_params['SysInsAt']."'"; }
			if($a_params['SysLstUpdUsr']){ $where .= " AND SysLstUpdUsr = '".$a_params['SysLstUpdUsr']."'"; }
			if($a_params['SysLstUpdAt']){ $where .= " AND SysLstUpdAt = '".$a_params['SysLstUpdAt']."'"; }
	    	
			$o_conexion = new BaseDatos();
			$con=$o_conexion->conectar();
			$sql = "SELECT pdo_ordenId, pdo_ordenIdChild, pdo_productoId, SysInsUsr, SysInsAt, SysLstUpdUsr, SysLstUpdAt  FROM mrp_ordenprod_child WHERE 1 ".$where;
			$result = mysql_db_query('main_db', $sql);
			$num_rows = mysql_num_rows($result);
	      
	      if($num_rows>0){
	        while ($o_valor = mysql_fetch_object($result)) {
	          $a_tmp[] = $o_valor;
	        }
	      }
	      
	      return $a_tmp;
	    }catch ( Exception $o_Error ){
	      throw new Exception($o_Error->getMessage().' en '.$o_Error->getFile().' linea '.$o_Error->getLine());
	    }
		
	}
	
}